package de.tud.etit.blipz.services.json;

import java.lang.reflect.Type;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import de.tud.etit.blipz.entities.User;

public class UserSerializer implements JsonSerializer<User> {

	@Override
	public JsonElement serialize(User entity, Type type,
			JsonSerializationContext ctx) {
		
		if(entity == null)
		{
			return null;
		}
		
		JsonObject jsonObject = new JsonObject();
		jsonObject.addProperty("mobileNr", entity.getMobileNr());
		jsonObject.addProperty("password", entity.getPassword());
		
		return jsonObject;
	}

}
